﻿// Dang Thanh update 2007.06.20
var xmlHttp;

function showResultSearch(xmlHttpResult){
	//		smc_ShowResult(xmlHttpResult,divNameShowError,divNameShowResult,urlGoto)
	//debugAjax= true;
	smc_ShowResult(xmlHttpResult,"divError","divMain","");
	//onFlagBack();		// Dang THanh udpate 2007.06.20		
	return;
} 	

function submitFormSearchText(oForm){
	try {
		if(! checkSearchText(oForm)) return false;
		var url="../run/mainajax.php?modul=sanpham&action=SearchText";
		var aParams = smc_GetRequestOfForm(oForm);
		//alert(url);
		smc_XmlHttpSend(url,"POST",aParams,"showResultSearch",true);
	} catch (e) {
		alert(e.description);
	}
	return false;
}

function SearchMenuLeft(action){
	try {
		
		var url="../run/mainajax.php"+action;
		//var aParams = smc_GetRequestOfForm(oForm);
		var aParams = new Array();
		//alert(aParams);
		smc_XmlHttpSend(url,"GETS",aParams,"showResultSearch",true);
		//alert(aParams);
	} catch (e) {
		alert(e.description);
	}
	return false;
}

function submitFormSearchDetail(oForm){
	try {
		
		//alert(getById("listDanhBaLoai").value);
		//alert(oForm);
		oForm.listDanhBaLoai.value =getCheckBoxManyValue(oForm.elements["loai"]);
		var url="../run/mainajax.php?modul=sanpham&action=SearchCatSanpham";
		var aParams = smc_GetRequestOfForm(oForm);
		//alert(oForm.listDanhBaLoai.value);
		smc_XmlHttpSend(url,"POST",aParams,"showResultSearch",true);
	} catch (e) {
		alert(e.description);
	}
	return false;
}

function checkSearchText(oForm){
	return checkBlank(oForm.tieu_de,"text tìm kiếm");
}
